package com.demo.beetl.func;

import org.beetl.core.Context;
import org.beetl.core.Function;

public class SubString implements Function{

	@Override
	public String call(Object[] arg, Context ctx) {
		if(arg.length != 1 || null == arg[0]){
			return "";
		}
		String str = null;
		str = (String) arg[0];
		if(null!=str&&str.length()>60){
			return str.substring(0,60)+"...";
		}
		return str;
	}

}
